<template>
  <keep-alive>
    <div class="content">
      <nav-title title="个人信息" />
      <!-- <button style="float:right;margin-top:-40px" @click="modify">修改</button> -->
      <folding title="基本信息" @feedback="setIsShowType">
        <div class="normal-info"><!-- @click="toBasic('first')" -->
          <div class="detailed-info-box">
            <div class="label">姓名</div>
            <div class="label-value">
              {{ bsinfo.name }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">姓名拼音</div>
            <div class="label-value">
              {{ bsinfo.nameAc }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">曾用名</div>
            <div class="label-value">
              {{ bsinfo.rsUsedName }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">性别</div>
            <div class="label-value">
              {{ bsinfo.sexValue }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">国籍</div>
            <div class="label-value">
              {{ bsinfo.countryValue }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">出生日期</div>
            <div class="label-value">
              {{ bsinfo.birthdate }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">民族</div>
            <div class="label-value">
              {{ bsinfo.ethnicGrpCdValue }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">籍贯</div>
            <div class="label-value">
              {{ bsinfo.nativePlaceChn }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">最高学历</div>
            <div class="label-value">
              {{ bsinfo.highestEducLvlValue }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">毕业院校</div>
            <div class="label-value">
              {{ bsinfo.cSchool }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">专业</div>
            <div class="label-value">
              {{ bsinfo.cMajor }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">参加工作日期</div>
            <div class="label-value">
              {{ bsinfo.startDtChn }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">入本公司时间</div>
            <div class="label-value">
              {{ bsinfo.rsWklifBgnDt }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">现在职称</div>
            <div class="label-value">
              {{ bsinfo.cPosition }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">政治面貌</div>
            <div class="label-value">
              {{ bsinfo.politicalStaChnValue }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">入党(团)日期</div>
            <div class="label-value">
              {{ bsinfo.cDate }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">有无驾照</div>
            <div class="label-value" v-if="bsinfo.cYesNo == 'Y'">
              有
            </div>
            <div class="label-value" v-if="bsinfo.cYesNo == 'N'">
              无
            </div>
            <div class="label-value" v-if="bsinfo.cYesNo != 'N' && bsinfo.cYesNo != 'Y'">
              
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">身高(CM)</div>
            <div class="label-value">
              {{ bsinfo.rsPersHeight }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">体重(KG)</div>
            <div class="label-value">
              {{ bsinfo.rsPersWeight }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">血型</div>
            <div class="label-value">
              {{ bsinfo.rsBloodTypeValue }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">健康状况</div>
            <div class="label-value">
              {{ bsinfo.rsHealthStatusValue}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">婚姻状况</div>
            <div class="label-value">
              {{ bsinfo.marStatusValue}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">生育状况</div>
            <div class="label-value">
              {{ bsinfo.cBearValue}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">证件类型</div>
            <div class="label-value">
              {{ bsinfo.nationalIdTypeValue}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">证件号码</div>
            <div class="label-value">
              {{ bsinfo.nationalId }}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">户籍地址</div>
            <div class="label-value">
              {{ bsinfo.addresslong1}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">家庭详细地址</div>
            <div class="label-value">
              {{ bsinfo.addresslong3}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">现在居住地址</div>
            <div class="label-value">
              {{ bsinfo.addresslong2}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">指定送达地址</div>
            <div class="label-value">
              {{ bsinfo.cSendTypeValue}}
              <div>
                <br>
                {{ bsinfo.cAddress}}
              </div>
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">住宅电话</div>
            <div class="label-value">
              {{ bsinfo.phone1}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">手机号码</div>
            <div class="label-value">
              {{ bsinfo.phone}}
            </div>
            <div class="icon"></div>
          </div>
          <div class="detailed-info-box">
            <div class="label">Email</div>
            <div class="label-value">
              {{ bsinfo.emailAddr}}
            </div>
            <div class="icon"></div>
          </div>
        </div>
      </folding>

      <div class="matters">
        <folding title="入公司后工作经历" @feedback="setIsShowType" :cnta="cnta" where-is="theCompanyBefore" :is-add="addOr">
          <div class="detailed">
            <!--点点代码块-->
            <div class="tip-time" v-for="(item, index) in afters">
              <div class="text-box">
                <img class="star" v-if="index%2 === 0" src="./image/star-green.png" alt="">
                <img class="star" v-else src="./image/star-blue.png" alt="">
                <div class="time-interval">
                  {{item.bgnDt|dateFormat}} - {{ item.endDt | formatDate}}
                </div>
                <div>
                  <span class="important"></span>{{item.cDescr}}
                </div>
                <div>{{item.cDescr1}} | {{item.rsJobLevel}}</div>
              </div>
              <div class="icon"></div>
            </div>
            <br>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="入公司前工作经历" @feedback="setIsShowType" :cnta="cnta" where-is="theCompanyBefore" :is-add="addOr">
          <div class="detailed">
            <!--点点代码块-->
            <div class="tip-time" v-for="(item, index) in expwVal">
              <div class="text-box" @click="toWorkExp(item)">
                <img class="star" v-if="index%2 === 0" src="./image/star-green.png" alt="">
                <img class="star" v-else src="./image/star-blue.png" alt="">
                <div class="time-interval">
                  {{item.startDt}} - {{item.endDt}}
                </div>
                <div>
                  <span class="important"></span>{{item.cCompany}}
                </div>
                <div>{{item.cPosition}}</div>
              </div>
              <div class="icon"><img src="./image/u252.png" alt=""></div>
            </div>
            <br>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="教育经历" @feedback="setIsShowType" :cnta="cnta" where-is="education" :is-add="addOr">
          <div class="detailed">
            <!--点点代码块-->
            <div class="tip-time" v-for="(item, index) in eduif">
              <div class="text-box" @click="toEdu(item)">
                <img class="star" v-if="index%2 === 0" src="./image/star-green.png" alt="">
                <img class="star" v-else src="./image/star-blue.png" alt="">
                <div class="time-interval">
                  {{item.startDt}} - {{item.endDt}}
                </div>
                <div>
                  {{item.cSchool}}
                </div>
                <div>{{item.cMajor}}</div>
                <div>{{item.cEducitonValue}} | {{item.cDegreeValue}}</div>
              </div>
              <div class="icon"><img src="./image/u252.png" alt=""></div>
            </div>
            <br>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="培训经历" @feedback="setIsShowType" :cnta="cnta" where-is="training" :is-add="addOr">
          <div class="detailed">
            <!--点点代码块-->
            <div class="tip-time" v-for="(item, index) in traVal">
              <div class="text-box" @click="totrain(item)">
                <img class="star" v-if="index%2 === 0" src="./image/star-green.png" alt="">
                <img class="star" v-else src="./image/star-blue.png" alt="">
                <div class="time-interval">
                  {{item.startDt}} - {{item.endDt}}
                </div>
                <div>
                  <span class="important"></span>{{item.cCompany}}
                </div>
                <div>{{item.cDescr}}</div>
              </div>
              <div class="icon"><img src="./image/u252.png" alt=""></div>
            </div>
            <br>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="资格证书" @feedback="setIsShowType" :cnta="cnta" where-is="qualification" :is-add="addOr">
          <div class="detailed">
            <!--点点代码块-->
            <div class="tip-time" v-for="(item, index) in zgzVal">
              <div class="text-box" @click="toquality(item)">
                <img class="star" v-if="index%2 === 0" src="./image/star-green.png" alt="">
                <img class="star" v-else src="./image/star-blue.png" alt="">
                <div class="time-interval">
                  {{item.cDate}} [ <span class="important">{{item.cDate1}}到期</span> ]
                </div>
                <div>
                  {{item.cName}} {{item.cLevel}}
                </div>
                <div>签发单位：<span class="important"></span>{{item.cCompany}}</div>
              </div>

              <div class="icon"><img src="./image/u252.png" alt=""></div>
            </div>
            <br>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="语言能力" @feedback="setIsShowType" :cnta="cnta" where-is="language" :is-add="addOr">
          <div class="ability" v-for="item in lanVal" style="border-bottom:1px solid #ccc;margin-bottom:10px;">
            <div class="content" @click="toLang(item)">
              <div class="line">
                <div class="detailed-info-box">
                  <div class="label">语言</div>
                  <div class="label-value">
                    {{item.rsLangCdValue}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">证书名称</div>
                  <div class="label-value">
                    {{item.cDescr}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">掌握程度</div>
                  <div class="label-value">
                    {{item.cLangLvValue}}
                  </div>
                  <div class="icon"></div>
                </div>
              </div>
            </div>
            <div class="icon">
              <img src="./image/u252.png" alt="">
            </div>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="计算机能力" @feedback="setIsShowType" :cnta="cnta" where-is="computer" :is-add="addOr">
          <div class="ability" v-for="item in pcVal">
            <div class="content" @click="toComputer(item)">
              <div class="line">
                <div class="detailed-info-box">
                  <div class="label">技能名称</div>
                  <div class="label-value">
                    {{item.cName}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">证书名称</div>
                  <div class="label-value">
                    {{item.cDescr}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">掌握程度</div>
                  <div class="label-value">
                    {{item.cTechLvValue}}
                  </div>
                  <div class="icon"><img src="./image/u252.png" alt=""></div>
                </div>
              </div>
            </div>
            <div class="icon">
              <img src="./image/u252.png" alt="">
            </div>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="奖惩情况" @feedback="setIsShowType" :cnta="cnta" where-is="rewardsAndPunishments" :is-add="addOr">
          <div class="detailed">
            <!--点点代码块-->
            <div class="tip-time" v-for="(item, index) in jcVal">
              <div class="text-box" @click="toReward(item)">
                <img class="star" v-if="index%2 === 0" src="./image/star-green.png" alt="">
                <img class="star" v-else src="./image/star-blue.png" alt="">
                <div class="time-interval">
                  {{item.cDate}} <span style="margin-left: 70px;color: black">{{item.rsJclbTypeValue}}</span>
                </div>
                <div>
                  {{item.cName}}
                </div>
                <div>颁发机构：{{item.cCompany}}</div>
              </div>
              <div class="icon">
                <img src="./image/u252.png" alt="">
              </div>
            </div>
            <br>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="个人特长及兴趣爱好" @feedback="setIsShowType" :is-add="false">
          <div class="ability"><!--  @click="toBasic('second')" -->
            <div class="content">
              <div class="line">
                <div class="detailed-info-box">
                  <div class="label">个人特长</div>
                  <div class="label-value">
                    {{ bsinfo.cDescrlong }}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">兴趣爱好</div>
                  <div class="label-value">
                    {{ bsinfo.rsHobby }}
                  </div>
                  <div class="icon"></div>
                </div>
              </div>
            </div>
            <div class="icon"></div>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="亲属关系" @feedback="setIsShowType" :cnta="cnta" where-is="family" :is-add="addOr">
          <div class="ability" v-for="item in famVal">
            <div class="content" @click="toFamily(item)">
              <div class="line">
                <div class="detailed-info-box">
                  <div class="label">姓名</div>
                  <div class="label-value">
                    {{item.cName}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">性别</div>
                  <div class="label-value">
                    {{item.cFamilySexValue}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">关系</div>
                  <div class="label-value">
                    {{item.cRelationFamValue}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">工作单位</div>
                  <div class="label-value">
                    {{item.cCompany}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">职务</div>
                  <div class="label-value">
                    {{item.cPosition}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">联系电话</div>
                  <div class="label-value">
                    {{item.cPhone}}
                  </div>
                </div>
              </div>
            </div>
            <div class="icon">
              <img src="./image/u252.png" alt="">
            </div>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="紧急情况联系人" @feedback="setIsShowType" :is-add="false">
          <div class="ability">
            <div class="content"><!--  @click="toEmergence()" -->
              <div class="line">
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>姓名</div>
                  <div class="label-value">
                    {{tcpVal.cName}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>性别</div>
                  <div class="label-value">
                    {{tcpVal.cTactPerSexValue}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>与本人关系</div>
                  <div class="label-value">
                    {{tcpVal.cRelationTactValue}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">工作单位</div>
                  <div class="label-value">
                    {{tcpVal.cCompany}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">办公电话</div>
                  <div class="label-value">
                    {{tcpVal.cPhone2}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>手机电话</div>
                  <div class="label-value">
                    {{tcpVal.cPhone1}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">住宅电话</div>
                  <div class="label-value">
                    {{tcpVal.cPhone}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">联系地址</div>
                  <div class="label-value">
                    {{tcpVal.cAddress}}
                  </div>
                  <div class="icon"></div>
                </div>
              </div>
            </div>
            <!--<div class="icon">-->
            <!--<img src="./image/u252.png" alt="">-->
            <!--</div>-->
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="银行账号信息" @feedback="setIsShowType" :is-add="false">
          <div class="ability">
            <div class="content"><!--  @click="toBank()" -->
              <div class="line">
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>开户银行名称</div>
                  <div class="label-value">
                    {{bankv}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">分/支行</div>
                  <div class="label-value">
                    {{bnkVal.rsBranchNm}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>银行账号</div>
                  <div class="label-value">
                    {{bnkVal.accountEcId}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>账户名称</div>
                  <div class="label-value">
                    {{bnkVal.accountName}}
                  </div>
                  <div class="icon"></div>
                </div>
              </div>
            </div>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="社保公积金账户" @feedback="setIsShowType" :is-add="false">
          <div class="ability" v-for="item in sbgVal">
            <div class="content" style="border-bottom:1px solid #ccc;margin-bottom:10px;">
              <div class="line"><!--  @click="tosocail(item)"  -->
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>账户类型</div>
                  <div class="label-value">
                    {{item.cDescr}}
                  </div>
                </div>
                <div class="detailed-info-box">
                  <div class="label">未参加过</div>
                  <div class="label-value">
                    {{item.cYesNo | yesOrmno}}
                  </div>
                  <div class="icon"></div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>账号</div>
                  <div class="label-value">
                    {{item.gpcnAcountNum}}
                  </div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>原缴纳地</div>
                  <div class="label-value">
                    {{item.cAddress}}
                  </div>
                </div>
                <div class="detailed-info-box">
                  <div class="label"><span class="important"></span>状态</div>
                  <div class="label-value">
                    {{item.cPhfStatusValue}}
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="detailed-info-box">
            <div class="label">本人档案所在地</div>
            <div class="label-value">
              {{ bsinfo.cArchiveAddr}}
            </div>
            <div class="icon"></div>
          </div>
        </folding>
      </div>

      <div class="matters">
        <folding title="其他需要说明的情况" @feedback="setIsShowType" :is-add="false">
          <div class="otherexp"><!--  @click="toBasic('third')" -->
            <div class="regulations">
              <div class="title">
                是否有过犯罪记录？
              </div>
              <div class="answer" v-if="bsinfo.cYesNo1 == 'N'">
                无
              </div>
              <div class="answer" v-if="bsinfo.cYesNo1 == 'Y'">
                {{ bsinfo.cDescrlong1 }}
              </div>
            </div>
            <div class="regulations">
              <div class="title">
                曾否因大病入院或患有特殊疾病？
              </div>
              <div class="answer" v-if="bsinfo.cYesNo2 == 'N'">
                无
              </div>
              <div class="answer" v-if="bsinfo.cYesNo2 == 'Y'">
                {{ bsinfo.cDescrlong2 }}
              </div>
            </div>
            <div class="regulations">
              <div class="title">
                是否对其他公司负竞业限制义务？
              </div>
              <div class="answer" v-if="bsinfo.cYesNo3 == 'N'">
                无
              </div>
              <div class="answer" v-if="bsinfo.cYesNo3 == 'Y'">
                {{ bsinfo.cDescrlong3 }}
              </div>
            </div>
            <div class="regulations">
              <div class="title">
                是否曾在本集团任职或建立过劳动关系？
              </div>
              <div class="answer" v-if="bsinfo.cYesNo4 == 'N'">
                无
              </div>
              <div class="answer" v-if="bsinfo.cYesNo4 == 'Y'">
                {{ bsinfo.cDescrlong4 }}
              </div>
            </div>
            <div class="regulations">
              <div class="title">
                其他补充说明
              </div>
              <div class="answer">{{ bsinfo.cDescrlong5 }}</div>
            </div>
          </div>
        </folding>
      </div>
      <!-- <div class="sub-btn-content">
        <div class="sub-save">保存</div>
      </div> -->
    </div>
  </keep-alive>
</template>

<script>
  import Folding from './common/Folding'
  import { dateFormat } from 'vux'
  import {getBasicUser,getPEdu,getDicItem,getPWork,getPTrain,getPlan,getPpc,getPjc,getPfam,getPtech,getPbnk,getPzcgl,getPsoc,getCountry,getNation,getBank,getTrsNum,getEmpAfter} from '../../api/api'
  import {json2Form} from '../../util/http'

  export default {
    name: 'user-info',
    data() {
      return {
        bsinfo: '',
        foldingIndex: -1,
        isFirst: false,
        foldings:[],
        eduif: [],
        sexVal: [],
        expwVal: [],
        eduVal: [],
        degVal: [],
        traVal: [{}],
        lanVal: [],
        lanlvVal: [],
        lantpVal: [],
        pcVal: [],
        pclvVal: [],
        jcVal: [],
        jctpVal: [],
        famVal: [],
        tcpVal: [],
        bankv: '',
        bnkVal: [],
        zgzVal: [],
        sbgVal: [],
        afters: [],
        cnta: '-1',
        perNo: {
          emplid: ''
        },
        cTransactionNbr: '',
        addOr: false,
      }
    },
    created() {
      this.getNta()
      if(this.$route.query.eplid){
        this.perNo.emplid = this.$route.query.eplid
      }else{
        if(this.$store.state.eid){
          this.perNo.emplid = this.$store.state.eid
        }
      }
      if(this.cTransactionNbr){
        this.cnta = this.cTransactionNbr
      }
    },
    components: {
      Folding
    },
    async mounted() {
      //alert(this.$route.params.archivesId);
      await this.$nextTick()
      this.foldings = this.$children.filter(value => value.hasOwnProperty('isShow'))
      this.setIsShowType();
    },
    methods: {
      getBsInfo() {
        getBasicUser(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            this.bsinfo = res.retData
            // this.getcoulb(res.retData.country)
            // this.getnatlb(res.retData.ethnicGrpCd)
          } else {
            alert(res.retMsg);
          }
        })
      },
      setIsShowType(title) {
        this.whichCh(title)
        if (this.foldingIndex < 0) {
          if(this.isFirst){
            this.foldings[0].isShow = true
            this.isFirst = false
          }
        } else {
          this.foldings[this.foldingIndex].isShow = false
        }
        this.foldingIndex = this.foldings.findIndex(value => value.isShow)
      },
      //工作后经历
      getAfters() {
        getEmpAfter(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            console.log(res.retData)
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.afters.push(...res.retData)
            }else{
              this.afters.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //工作前经历
      getExpwork() {
        getPWork(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.expwVal.push(...res.retData)
            }else{
              this.expwVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //获取教育经历
      getEdus() {
        getPEdu(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.eduif.push(...res.retData)
            }else{
              this.eduif.push(res.retData)
            }
            console.log(res.retData)
          } else {
            alert(res.retMsg);
          }
        })
      },
      //培训经历
      getTras() {
        this.traVal = []
        let params = {rsHireId: this.empid}
        getPTrain(this.perNo).then(res => {
          if (res && res.retCode === '000000') { 
          console.log(res.retData)  
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.traVal.push(...res.retData)
            }else{
              this.traVal.push(res.retData)
            }
            //console.log(this.traVal)
          } else {
            alert(res.retMsg);
          }
        })
      },
      //资格证书
      getzgzss() {
        this.zgzVal = []
        let params = {rsHireId: this.empid}
        getPzcgl(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            console.log(res.retData)
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.zgzVal.push(...res.retData)
            }else{
              this.zgzVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //语言能力
      getLans() {
        this.lanVal = []
        getPlan(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.lanVal.push(...res.retData)
            }else{
              this.lanVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //计算机能力
      getPclvs() {
        let params = {rsHireId: this.empid}
        getPpc(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.pcVal.push(...res.retData)
            }else{
              this.pcVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //奖惩情况
      getJxs() {
        let params = {rsHireId: this.empid}
        getPjc(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.jcVal.push(...res.retData)
            }else{
              this.jcVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //亲属信息
      getFams() {
        let params = {rsHireId: this.empid}
        getPfam(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.famVal.push(...res.retData)
            }else{
              this.famVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },
      //紧急联系人
      getTacps() {
        let params = {rsHireId: this.empid}
        getPtech(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            this.tcpVal = res.retData
          } else {
            alert(res.retMsg);
          }
        })
      },
      //银行信息
      getBnkaccs() {
        let params = {rsHireId: this.empid}
        getPbnk(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            this.bnkVal = res.retData
            this.getBanklb(res.retData.bankCd)
          } else {
            alert(res.retMsg);
          }
        })
      },
      //社保公积金
      getsbgj() {
        getPsoc(this.perNo).then(res => {
          if (res && res.retCode === '000000') {
            if(Object.prototype.toString.call(res.retData) === '[object Array]'){
              this.sbgVal.push(...res.retData)
            }else{
              this.sbgVal.push(res.retData)
            }
          } else {
            alert(res.retMsg);
          }
        })
      },

      //国籍
      getcoulb(cou) {
        getCountry().then(res => {
          res.retData.forEach((val) => {
            if(val.country == cou){
              this.bsinfo.country = val.descrshort
            }
          });
        })
      },
      //民族
      getnatlb(nat) {
        getNation().then(res => {
          res.retData.forEach((val) => {
            if(val.ethnicGrpCd == nat){
              this.bsinfo.ethnicGrpCd = val.descrshort
            }
          });
        })
      },
      //银行
      getBanklb(valbnk) {
        getBank().then(res => {
          res.retData.forEach((val) => {
            if(val.bankCd == valbnk){
              this.bankv = val.descrshort
            }
          });
        })
      },
      //婚姻
      getmarDic() {
        let params = {
          fileName: 'MAR_STATUS'
        }
        getDicItem(params).then(res => {
          res.retData.forEach((val) => {
            this.mryVal.push({value: val.xlatshortname, key: val.fieldvalue})
          });
          console.log(mryVal)
        }).catch(res => {

        })
      },
      //指定送达
      getsendDic() {
        let params = {
          fileName: 'C_SEND_TYPE'
        }
        getDicItem(params).then(res => {
          res.retData.forEach((val) => {
            this.sendVal.push({value: val.xlatshortname, key: val.fieldvalue})
          });
        }).catch(res => {

        })
      },
      whichCh(val) {
        switch (val)
        {
          case '基本信息':
            if(this.bsinfo.length == 0){
              this.getBsInfo()
            }
          break;
          case '入公司后工作经历':
            if(this.afters.length == 0){
              this.getAfters()
            }
          break;
          case '入公司前工作经历':
            if(this.expwVal.length == 0){
              this.getExpwork()
            }
          break;
          case '教育经历':
            if(this.eduif.length == 0){
              this.getEdus()
            }
          break;
          case '培训经历':
          //if(this.traVal.length == 0){
            this.getTras()
          //}
          break;
          case '资格证书':
          //if(this.zgzVal.length == 0){
            this.getzgzss()
          //}
          break;
          case '语言能力':
          if(this.lanVal.length == 0){
            this.getLans()
          }
          break;
          case '计算机能力':
          if(this.pcVal.length == 0){
            this.getPclvs()
          }
          break;
          case '奖惩情况':
          if(this.jcVal.length == 0){
            this.getJxs()
          }
          break;
          case '个人特长及兴趣爱好':
          if(this.bsinfo.length == 0){
            this.getBsInfo()
          }
          break;
          case '亲属信息':
          if(this.famVal.length == 0){
            this.getFams()
          }
          break;
          case '紧急情况联系人':
          if(this.tcpVal.length == 0){
            this.getTacps()
          }
          break;
          case '银行账号信息':
          if(this.bnkVal.length == 0){
            this.getBnkaccs()
          }
          break;
          case '社保公积金账户':
          if(this.sbgVal.length == 0){
            this.getsbgj()
            this.getBsInfo()
          }
          break;
          case '其他需要说明的情况':
          if(this.bsinfo.length == 0){
            this.getBsInfo()
          }
          break;
        }
      },

      //修改按钮
      modify() {
        this.getTrNum()
        this.addOr = true
      },

      //跳转基本信息
      toBasic(whch) {
        this.$router.push({  
          name:'pbasicif',  
          params:{ 
            ctn: this.cTransactionNbr,
            whc: whch
          }  
        }) 
      },
      //工作经历
      toWorkExp(item) {
        this.$router.push({
          name:'ptheCompanyBefore',  
          params:{ 
            workexp: item,
            ctn: this.cTransactionNbr
          } 
        })
      },
      //教育经历
      toEdu(item){
        this.$router.push({
          name:'peducation',  
          params:{ 
            edult: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      //培训经历
      totrain(item) {
        this.$router.push({
          name:'ptraining',  
          params:{ 
            tralt: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      //资格证书
      toquality(item) {
        this.$router.push({
          name:'pqualification',  
          params:{ 
            qualt: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      //语言能力
      toLang(item) {
        this.$router.push({
          name:'planguage',  
          params:{ 
            lang: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          }
        })
      },
      //跳转计算机
      toComputer(item) {
        this.$router.push({
          name:'pcomputer',  
          params:{ 
            coup: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      //奖惩
      toReward(item) {
        this.$router.push({
          name:'prewardsAndPunishments',  
          params:{ 
            rewd: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      //家庭
      toFamily(item) {
        this.$router.push({
          name:'pfamily',  
          params:{ 
            fam: item,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      //紧急联系
      toEmergence() {
        this.$router.push({
          name:'pemergent',  
          params:{ 
            emeg: this.tcpVal,
            ctn: this.cTransactionNbr,
            cModStauts: 'U'
          } 
        })
      },
      toBank(){
        this.$router.push({
          name:'pbank',  
          params:{ 
            banklt: this.bnkVal,
            ctn: this.cTransactionNbr
          } 
        })
      },
      tosocail(item){
        this.$router.push({
          name:'psocsec',  
          params:{ 
            socvl: item,
            ctn: this.cTransactionNbr
          } 
        })
      },
      getTrNum(){
        getTrsNum().then(res=>{
          console.log(res.retData)
          this.cTransactionNbr = res.retData
          this.cnta = res.retData
        })
      },
      //获取子页面路由里是否有流水
      getNta() {
        if(this.$route.params.cnta){
          this.cTransactionNbr = this.$route.params.cnta
          this.addOr = true
          //console.log('liushui'+this.cTransactionNbr)
        }else{
          //console.log('传值失败')
        }
      },
      //判断是否数组
      ObjToArr(val,arr) {
        arr = []
        if(Object.prototype.toString.call(val) ==='[object Array]'){
          arr.push(...val)
        }else{
          arr.push(val)
        }
      },
    },
    filters: {
      // marryFt(marlv,marArr=[]) {
      //   if (marlv && marArr.length > 0) {
      //     return marArr.find(val => val.key === marlv) ? marArr.find(val => val.key === marlv)['value'] : ''
      //   }
      //   return ''
      // },
      // bearFt(bearvl,bearArr=[]){
      //   if (bearvl && bearArr.length > 0) {
      //     return bearArr.find(val => val.value === bearvl) ? bearArr.find(val => val.value === bearvl)['name'] : ''
      //   }
      //   return ''
      // },
      // nationFt(natvl,natArr=[]){
      //   if (natvl && natArr.length > 0) {
      //     return natArr.find(val => val.value === natvl) ? natArr.find(val => val.value === natvl)['name'] : ''
      //   }
      //   return ''
      // },

      yesOrmno(val){
        if(val=='Y'){
          return "是"
        }else{
          return "否"
        }
      },

      formatDate(time){
        if(time){        
          let date = new Date(time);
          let Y = date.getFullYear() + '-';
          let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
          let D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate());
          return Y+M+D;
          //此处formatDate是一个函数，将其封装在common/js/date.js里面，便于全局使用
        }else{
          return '至今'
        }
      }

    }
  }
</script>

<style type="text/scss" lang="scss" scoped>
  @import "./style";
</style>
